/**
 * Changes class of element on event
 */
 
$.fn.stateSwitcher = function(params){
	params = (params != undefined)? params:{};
	var options = {};
	
	options.selector  = (params.selector != undefined)? params.selector:false;
	options.activeClass = (params.activeClass != undefined)? params.activeClass:false;
	options.activateEvent = (params.activateEvent != undefined)? params.activateEvent:'click';
	options.collection = $(options.selector);
	
	return this.each(function(){
		$(this).bind(options.activateEvent, function(e){
			options.collection.removeClass(options.activeClass);
			$(this).addClass(options.activeClass);
			return false;
		});
	});
};